// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.domain;
/**
 * @see org.tinaelle.server.domain.AdAlertRule
 */
public class AdAlertRuleDaoImpl
    extends org.tinaelle.server.domain.AdAlertRuleDaoBase
{
    /**
     * @see org.tinaelle.server.domain.AdAlertRuleDao#toAdAlertRuleDTO(org.tinaelle.server.domain.AdAlertRule)
     */
    public org.tinaelle.common.dto.AdAlertRuleDTO toAdAlertRuleDTO(final org.tinaelle.server.domain.AdAlertRule entity)
    {
        return super.toAdAlertRuleDTO(entity);
    }

    /**
     * Retrieves the entity object that is associated with the specified value object
     * from the object store. If no such entity object exists in the object store,
     * a new, blank entity is created
     */
    private org.tinaelle.server.domain.AdAlertRule loadAdAlertRuleFromAdAlertRuleDTO(org.tinaelle.common.dto.AdAlertRuleDTO adAlertRuleDTO)
    {
        org.tinaelle.server.domain.AdAlertRule adAlertRule = this.load(adAlertRuleDTO.getAdAlertRuleId());
        if (adAlertRule == null)
        {
            adAlertRule = org.tinaelle.server.domain.AdAlertRule.Factory.newInstance();
        }
        return adAlertRule;
    }

    
    /**
     * @see org.tinaelle.server.domain.AdAlertRuleDao#adAlertRuleDTOToEntity(org.tinaelle.common.dto.AdAlertRuleDTO)
     */
    public org.tinaelle.server.domain.AdAlertRule adAlertRuleDTOToEntity(org.tinaelle.common.dto.AdAlertRuleDTO adAlertRuleDTO)
    {
        org.tinaelle.server.domain.AdAlertRule entity = this.loadAdAlertRuleFromAdAlertRuleDTO(adAlertRuleDTO);
        this.adAlertRuleDTOToEntity(adAlertRuleDTO, entity, true);
        return entity;
    }
}